import ktor.KtorAuthDataSource

class AuthRepositoryImpl(
    private val dataSource: KtorAuthDataSource
) : AuthRepository {
    override suspend fun login(username: String, password: String): Result<String> {
        return dataSource.login(username, password).checkNullAndGet()
    }

    override suspend fun register(username: String, password: String): Result<String> {
        return dataSource.register(username, password).checkNullAndGet()
    }

    override fun isTokenWritten(): Boolean {
        return dataSource.isTokenWritten()
    }
}